var alerts = document.querySelectorAll(".alert-wrapper .alert");

$(function(){
    $(".zc_btn").click(function(){
        let uname =$("#username");
        let wpwd = $("#password");
       
        $.ajax({
            url : "http://localhost/server/register.php",
            //post请求
            type:"POST",
            data : {
                username :uname.val(),
                password : wpwd.val()
            },
            dataType:"json"
        })
        
        .done(function(res){
            // console.log(res);
            alerts[0].style.display = "block";
            setTimeout( function(){
                      location.href = "./the_login.html";
                } , 800 )
        })
    })
})